// @ts-nocheck

export default {
  async pointClickType({ type = '', layerIndex = 0, coordinatesSystem = 'cgcs2000' } = {}) {
    const self = this;
    if (type == '清除所有') {
      // 撒点 增删改 一体 覆盖写入方法
      await self.vickMapPostMessage({
        key: 'editLayerOverlayPoint',
        value: {
          layerIndex: layerIndex
        }
      });
    } else if (type == '批量绘制点标记') {
      const value = {
        layerIndex: layerIndex,
        resultJson: [
          {
            id: 'test-point.1', // 必填
            coordinates: [-100.515909, 31.0822]
          },
          {
            id: 'test-point.2',
            coordinates: [-99.515411, 33.0841004],
            properties: { textValue: '景区', textStrokeColor: 'rgba(255,0,0,1)', onlyText: true }
          },
          {
            id: 'test-point.3',
            coordinates: [-98.513794, 31.0803774],
            properties: {
              textValue: '景区',
              textFont: 12,
              textStrokeWidth: 0,
              textFillColor: 'rgba(0,255,0,1)',
              textOffsetX: 0,
              textOffsetY: 30,
              onlyText: false,
              imageColor: '#00ff00',
              imageSrc: '../test/test-02.png'
            }
          }
        ],
        coordinatesSystem: coordinatesSystem
      };
      await self.vickMapPostMessage({
        key: 'editLayerOverlayPoint',
        value: value
      });
    }
  }
};
